package views;

import java.util.List;

import com.evaluity.R;

import logic.Question;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class QuestionAdapter extends ArrayAdapter<Question> {
	
	Context context;
	List<Question> questions;

	public QuestionAdapter(Context context, int textViewResourceId, List<Question> questions) {
		super(context, textViewResourceId, questions);
		this.context = context;
		this.questions = questions;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
//		ImageView icon = (ImageView) convertView.findViewById(R.id.row_icon);
//		icon.setImageResource(getItem(position).iconRes);
		if (convertView == null) {
			convertView = LayoutInflater.from(getContext()).inflate(R.layout.question_item, null);
		}
		TextView title = (TextView) convertView.findViewById(R.id.row_title);
		title.setText(getItem(position).getText());

		return convertView;
	}
}
